package net.hn.hnms.biz.plan.group.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import net.hn.hnms.biz.plan.group.service.GroupBigScreenSerevice;
import net.hn.hnms.biz.plan.group.service.GroupService;
import net.hn.hnms.biz.plan.group.service.GroupStatisticService;
import net.hn.hnms.biz.plan.vo.*;
import net.hn.hnms.sys.common.core.domain.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@Api(value = "产销掘大屏", tags = {"集团产销掘大屏相关"})
@RestController
@RequestMapping("groupBigScreen/groupStatistic")
@EnableScheduling
public class GroupBigScreenController {


    @Autowired
    private GroupBigScreenSerevice groupBigScreenSerevice;

    @Autowired
    private GroupService groupService;

    @Autowired
    private GroupStatisticService groupStatisticService;


    @ApiOperation("大屏-产量 销量 掘进 剥离 情况(type1日，2月，3年)")
    @GetMapping("/getProductionAndSalesExcavationStatus")
    public R<CoalMiningTotalVo> getDailyOutputStatus(@ApiParam("type1日，2月，3年")Integer type, @ApiParam("煤企编码") String companyCode) {
        return R.ok(groupBigScreenSerevice.getDailyOutputStatus(type,companyCode));
    }
    @ApiOperation("大屏-产量 销量 掘进 剥离 完成率排名(type1日，2月，3年)(flag1产量，2销量，3掘进，4剥离)")
    @GetMapping("/getCompletionRateRanking")
    public R<List<CoalMiningTotalVo>> getCompletionRateRanking(Integer type,Integer flag) {
        return R.ok(groupBigScreenSerevice.getCompletionRateRanking(type,flag));
    }

    @ApiOperation("大屏-产量 销量 掘进 剥离 计划与实际对比")
    @GetMapping("/getPlanAndActualContrast")
    public R<List<CoalMiningTotalVo>> getPlanAndActualContrast(@ApiParam("(type 1煤炭产业，2公司，3矿)") Integer type, @ApiParam("(level 1年，2月，3日)") Integer level, @ApiParam("(flag 3掘进，4剥离") Integer flag, @ApiParam("(companyCode 公司编码")String companyCode) {
        return R.ok(groupBigScreenSerevice.getPlanAndActualContrast(type,level,flag,companyCode));
    }

    @ApiOperation("大屏-产量 销量变化趋势(type1年，2月，3日)(level 1煤业，2公司)")
    @GetMapping("/getTrendProductionAndSale")
    public R< Map<String, List<CoalMiningTotalVo>>> getTrendProductionAndSale(@ApiParam("(type 1年，2月，3日)")Integer type,  @ApiParam("( 1煤业，2公司)")Integer level) {
        return R.ok(groupBigScreenSerevice.getTrendProductionAndSale(type,level));
    }


    @ApiOperation("大屏-重点跟踪信息")
    @GetMapping("/getWorkTrackingInfo")
    public R<List<WorkTrackingInfoVo>> getWorkTrackingInfo(@ApiParam("煤企编码") String companyCode, @ApiParam("煤矿编码") String code) {
        return R.ok(groupBigScreenSerevice.getWorkTrackingInfo(companyCode,code));
    }

    @ApiOperation("大屏-库存-type 1煤炭产业，2矿")
    @GetMapping("/getStock")
    public R<List<CoalMiningTotalVo>> getStock(@ApiParam("(type 1煤炭产业，2煤业，3矿)") Integer type, String  companyCode) {
        return R.ok(groupBigScreenSerevice.getStock(type,companyCode));
    }

    @ApiOperation("大屏-产量 销量 掘进 剥离 同环比")
    @GetMapping("/getSameRingCompare")
    public R<List<CoalMiningYoyMomVo>> getSameRingCompare(@ApiParam("(type 1年，2月，3日)") Integer type) {
        return R.ok(groupBigScreenSerevice.getSameRingCompare(type));
    }

    @ApiOperation("大屏-煤矿信息")
    @GetMapping("/getMineInfo")
    public R<List<MineInfoVo>> getMineInfo() {
        return R.ok(groupBigScreenSerevice.getMineInfo(null));
    }

    @ApiOperation("大屏-安全生产信息")
    @GetMapping("/getSafetyMineInfo")
    public R<List<MineInfoVo>> getSafetyMineInfo(@ApiParam("(井工矿/露天矿)") String type) {
        return R.ok(groupBigScreenSerevice.getSafetyMineInfo(type));
    }

    @ApiOperation("大屏-掘进工作面-煤矿下拉框")
    @GetMapping("/getDrivingWorkingFaceMine")
    public R<List<MineInfoVo>> getDrivingWorkingFaceMine(@ApiParam("(井工矿/露天矿)") String type) {
        return R.ok(groupBigScreenSerevice.getDrivingWorkingFaceMine(type));
    }
    @ApiOperation("大屏-掘进工作面下拉框")
    @GetMapping("/getDrivingWorkingFace")
    public R<List<MineInfoVo>> getDrivingWorkingFace(@ApiParam("煤矿名称") String Name) {
        return R.ok(groupBigScreenSerevice.getDrivingWorkingFace(Name));
    }

    @ApiOperation("大屏-掘进 剥离变化趋势")
    @GetMapping("/getTrendDrivingAndStripped")
    public R<List<MineInfoVo>> getTrendDrivingAndStripped(@ApiParam("(type 1月，2日)")Integer type,  @ApiParam("工作面名称")String WorkingFace,@ApiParam("掘进1/剥离2")Integer flag) {
        return R.ok(groupBigScreenSerevice.getTrendDrivingAndStripped(null,type,WorkingFace,flag));
    }

    @ApiOperation("大屏-环保月度考核排名")
    @GetMapping("/getEnvironmentalMonthlyAssessmentRanking")
    public R<List<EnvironmentRankingVo>> getEnvironmentalMonthlyAssessmentRanking() {
        return R.ok(groupBigScreenSerevice.getEnvironmentalMonthlyAssessmentRanking());
    }


    @ApiOperation("大屏-环保传输有效率")
    @GetMapping("/getEnvironmentalEfficientTransmission")
    public R<List<EfficientTransmissionVo>> getEnvironmentalEfficientTransmission() {
        return R.ok(groupBigScreenSerevice.getEnvironmentalEfficientTransmission());
    }
    @ApiOperation("大屏-矿井状态信息")
    @GetMapping("/getMineStatusInfo")
    public R<List<MineNumberVo>> getMineStatusInfo(@ApiParam("煤企编码") String companyCode) {
        return R.ok(groupBigScreenSerevice.getMineNumberStatus(companyCode));
    }
    @ApiOperation("PC-核定产能")
    @GetMapping("/getMineProdCapacity")
    public R<List<MineInfoVo>> getMineProdCapacity(@ApiParam("煤企编码") String companyCode) {
        return R.ok(groupBigScreenSerevice.getMineProdCapacity(companyCode));
    }
    @ApiOperation("PC-工作面状态")
    @GetMapping("/getMineWorkingFaceStatus")
    public R<List<MineInfoVo>> getMineWorkingFaceStatus(@ApiParam("煤企编码") String companyCode) {
        return R.ok(groupBigScreenSerevice.getMineWorkingFaceStatus(companyCode));
    }







}
